/*
 * @Author: szx
 * @Date: 2022-04-04 15:20:45
 * @LastEditTime: 2022-04-04 15:27:30
 * @Description:
 * @FilePath: \leetcode\剑指offerII\032\032.js
 */
var isAnagram = function (s, t) {
    if (s.length != t.length) return false;
    const arr = new Array(26).fill(0);
    let flag = false;
    for (let i = 0; i < s.length; i++) {
        arr[s.charCodeAt(i) - 97]++;
        arr[t.charCodeAt(i) - 97]--;
        if (arr[t] != arr[s]) flag = true;
    }
    if (!flag) return false;
    for (let i of arr) if (i != 0) return false;
    return true;
};
